@import url('../var.css');

.letter-keyboard {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--vkb-key-color);
  background-color: var(--vkb-background);
}

.letter-keyboard-temp {
  position: absolute;
  top: -52px;
  display: flex;
  gap: var(--vkb-key-gap);
  width: 100%;
  height: var(--vkb-keyboard-tab);
  padding: var(--vkb-key-gap) 0;
  background-color: var(--vkb-background);
}

.letter-keyboard-temp-pinyin {
  position: absolute;
  z-index: 1;
  top: calc(var(--vkb-keyboard-tab) / -2);
  left: 0;
  padding: 0 var(--vkb-key-gap);
  height: calc(var(--vkb-keyboard-tab) / 2);
  width: min-content;
  background-color: var(--vkb-background);
}

.letter-keyboard-temp-list {
  display: flex;
  gap: var(--vkb-key-gap);
  width: 80%;
  height: 100%;
  overflow: hidden;
}

.letter-keyboard-temp-char {
  display: flex;
  align-items: center;
  width: min-content;
  padding: 0 10px;
  height: 100%;
  background-color: var(--vkb-key-background);
  cursor: pointer;
  border: var(--vkb-key-border-width) solid var(--vkb-key-border-color);
  box-shadow: 0 0 var(--vkb-key-shadow-width) var(--vkb-key-shadow-color);
  box-sizing: border-box;
}

.letter-keyboard-temp-right,
.letter-keyboard-temp-left {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(10% - var(--vkb-key-gap));
  height: 100%;
  color: var(--vkb-key-color);
  fill: var(--vkb-key-color);
  background-color: var(--vkb-key-background);
  border: var(--vkb-key-border-width) solid var(--vkb-key-border-color);
  box-shadow: 0 0 var(--vkb-key-shadow-width) var(--vkb-key-shadow-color);
  box-sizing: border-box;
}

.letter-keyboard-temp-right svg,
.letter-keyboard-temp-left svg {
  width: var(--vkb-keyboard-svg-size);
  height: var(--vkb-keyboard-svg-size);
}

.letter-keyboard-temp-char:active,
.letter-keyboard-temp-right:active,
.letter-keyboard-temp-left:active {
  background-color: var(--vkb-key-active-background);
  box-shadow: 0 0 var(--vkb-key-shadow-width) var(--vkb-key-active-shadow-color);
  border: var(--vkb-key-border-width) solid var(--vkb-key-active-border-color);
}

.letter-keyboard-temp-right:active svg,
.letter-keyboard-left:active svg {
  fill: var(--vkb-key-active-font-color);
}

.letter-keyboard-area {
  display: grid;
  grid-template-columns: repeat(10, calc((100% - var(--vkb-key-gap) * 9) / 10));
  gap: var(--vkb-key-gap);
  height: 100%;
}

.letter-key-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--vkb-key-background);
  border: var(--vkb-key-border-width) solid var(--vkb-key-border-color);
  box-shadow: 0 0 var(--vkb-key-shadow-width) var(--vkb-key-shadow-color);
  box-sizing: border-box;
  border-radius: var(--vkb-key-borer-radius);
  transition: all 0.3s;
  cursor: pointer;
}

.letter-key-item:active {
  background-color: var(--vkb-key-active-background);
  box-shadow: 0 0 var(--vkb-key-shadow-width) var(--vkb-key-active-shadow-color);
  border: var(--vkb-key-border-width) solid var(--vkb-key-active-border-color);
}

.letter-key-item:nth-child(n + 11):nth-child(-n + 19) {
  margin-left: calc(50% + var(--vkb-key-gap) / 2);
  width: 100%;
}

.letter-key-item:nth-child(20) {
  grid-column: 1;
  grid-row: 3;
  width: calc(150% + var(--vkb-key-gap) / 2);
}

.letter-key-item:nth-child(n + 21):nth-child(-n + 28) {
  grid-column: auto;
  grid-row: 3;
  margin-left: calc(50% + var(--vkb-key-gap) / 2);
}

.letter-key-item:nth-child(28) {
  width: calc(150% + var(--vkb-key-gap) / 2);
}

.letter-key-item:nth-child(n + 29) {
  grid-row: 4;
}

.letter-key-item:nth-child(29) {
  width: calc(200% + var(--vkb-key-gap));
}

.letter-key-item:nth-child(30) {
  margin-left: calc(100% + var(--vkb-key-gap));
  width: calc(600% + var(--vkb-key-gap) * 5);
}

.letter-key-item:nth-child(31) {
  margin-left: calc(600% + var(--vkb-key-gap) * 6);
  width: calc(200% + var(--vkb-key-gap));
}

.letter-caps-lock-small,
.letter-shift-small {
  font-size: 12px;
}

.letter-key-item > svg {
  width: var(--vkb-keyboard-svg-size);
  height: var(--vkb-keyboard-svg-size);
}
